3.1.61 \(\int \frac {c+d x}{(a+b \tan (e+f x))^2} \, dx\) [61]

3.1.61.1 Optimal result
3.1.61.2 Mathematica [B] (verified)
3.1.61.3 Rubi [A] (verified)
3.1.61.4 Maple [B] (verified)
3.1.61.5 Fricas [B] (verification not implemented)
3.1.61.6 Sympy [F]
3.1.61.7 Maxima [B] (verification not implemented)
3.1.61.8 Giac [F]
3.1.61.9 Mupad [F(-1)]

3.1.61.1 Optimal result

Integrand size = 18, antiderivative size = 214 \[ \int \frac {c+d x}{(a+b \tan (e+f x))^2} \, dx=-\frac {(c+d x)^2}{2 \left (a^2+b^2\right ) d}+\frac {(b d+2 a c f+2 a d f x)^2}{4 a (a+i b) \left (a^2+b^2\right ) d f^2}+\frac {b (b d+2 a c f+2 a d f x) \log \left (1+\frac {\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{\left (a^2+b^2\right )^2 f^2}-\frac {i a b d \operatorname {PolyLog}\left (2,-\frac {\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{\left (a^2+b^2\right )^2 f^2}-\frac {b (c+d x)}{\left (a^2+b^2\right ) f (a+b \tan (e+f x))} \]

output
-1/2*(d*x+c)^2/(a^2+b^2)/d+1/4*(2*a*d*f*x+2*a*c*f+b*d)^2/a/(a+I*b)/(a^2+b^ 
2)/d/f^2+b*(2*a*d*f*x+2*a*c*f+b*d)*ln(1+(a^2+b^2)*exp(2*I*(f*x+e))/(a+I*b) 
^2)/(a^2+b^2)^2/f^2-I*a*b*d*polylog(2,-(a^2+b^2)*exp(2*I*(f*x+e))/(a+I*b)^ 
2)/(a^2+b^2)^2/f^2-b*(d*x+c)/(a^2+b^2)/f/(a+b*tan(f*x+e))
 
3.1.61.2 Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(745\) vs. \(2(214)=428\).

Time = 7.89 (sec) , antiderivative size = 745, normalized size of antiderivative = 3.48 \[ \int \frac {c+d x}{(a+b \tan (e+f x))^2} \, dx=\frac {(e+f x) (-2 d e+2 c f+d (e+f x)) \sec ^2(e+f x) (a \cos (e+f x)+b \sin (e+f x))^2}{2 (a-i b) (a+i b) f^2 (a+b \tan (e+f x))^2}+\frac {b^2 d (-b (e+f x)+a \log (a \cos (e+f x)+b \sin (e+f x))) \sec ^2(e+f x) (a \cos (e+f x)+b \sin (e+f x))^2}{a (a-i b) (a+i b) \left (a^2+b^2\right ) f^2 (a+b \tan (e+f x))^2}-\frac {2 b d e (-b (e+f x)+a \log (a \cos (e+f x)+b \sin (e+f x))) \sec ^2(e+f x) (a \cos (e+f x)+b \sin (e+f x))^2}{(a-i b) (a+i b) \left (a^2+b^2\right ) f^2 (a+b \tan (e+f x))^2}+\frac {2 b c (-b (e+f x)+a \log (a \cos (e+f x)+b \sin (e+f x))) \sec ^2(e+f x) (a \cos (e+f x)+b \sin (e+f x))^2}{(a-i b) (a+i b) \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2}-\frac {d \left (e^{i \arctan \left (\frac {a}{b}\right )} (e+f x)^2+\frac {a \left (i (e+f x) \left (-\pi +2 \arctan \left (\frac {a}{b}\right )\right )-\pi \log \left (1+e^{-2 i (e+f x)}\right )-2 \left (e+f x+\arctan \left (\frac {a}{b}\right )\right ) \log \left (1-e^{2 i \left (e+f x+\arctan \left (\frac {a}{b}\right )\right )}\right )+\pi \log (\cos (e+f x))+2 \arctan \left (\frac {a}{b}\right ) \log \left (\sin \left (e+f x+\arctan \left (\frac {a}{b}\right )\right )\right )+i \operatorname {PolyLog}\left (2,e^{2 i \left (e+f x+\arctan \left (\frac {a}{b}\right )\right )}\right )\right )}{\sqrt {1+\frac {a^2}{b^2}} b}\right ) \sec ^2(e+f x) (a \cos (e+f x)+b \sin (e+f x))^2}{(a-i b) (a+i b) \sqrt {\frac {a^2+b^2}{b^2}} f^2 (a+b \tan (e+f x))^2}+\frac {\sec ^2(e+f x) (a \cos (e+f x)+b \sin (e+f x)) \left (-b^2 d e \sin (e+f x)+b^2 c f \sin (e+f x)+b^2 d (e+f x) \sin (e+f x)\right )}{a (a-i b) (a+i b) f^2 (a+b \tan (e+f x))^2} \]

input
Integrate[(c + d*x)/(a + b*Tan[e + f*x])^2,x]
 
output
((e + f*x)*(-2*d*e + 2*c*f + d*(e + f*x))*Sec[e + f*x]^2*(a*Cos[e + f*x] + 
 b*Sin[e + f*x])^2)/(2*(a - I*b)*(a + I*b)*f^2*(a + b*Tan[e + f*x])^2) + ( 
b^2*d*(-(b*(e + f*x)) + a*Log[a*Cos[e + f*x] + b*Sin[e + f*x]])*Sec[e + f* 
x]^2*(a*Cos[e + f*x] + b*Sin[e + f*x])^2)/(a*(a - I*b)*(a + I*b)*(a^2 + b^ 
2)*f^2*(a + b*Tan[e + f*x])^2) - (2*b*d*e*(-(b*(e + f*x)) + a*Log[a*Cos[e 
+ f*x] + b*Sin[e + f*x]])*Sec[e + f*x]^2*(a*Cos[e + f*x] + b*Sin[e + f*x]) 
^2)/((a - I*b)*(a + I*b)*(a^2 + b^2)*f^2*(a + b*Tan[e + f*x])^2) + (2*b*c* 
(-(b*(e + f*x)) + a*Log[a*Cos[e + f*x] + b*Sin[e + f*x]])*Sec[e + f*x]^2*( 
a*Cos[e + f*x] + b*Sin[e + f*x])^2)/((a - I*b)*(a + I*b)*(a^2 + b^2)*f*(a 
+ b*Tan[e + f*x])^2) - (d*(E^(I*ArcTan[a/b])*(e + f*x)^2 + (a*(I*(e + f*x) 
*(-Pi + 2*ArcTan[a/b]) - Pi*Log[1 + E^((-2*I)*(e + f*x))] - 2*(e + f*x + A 
rcTan[a/b])*Log[1 - E^((2*I)*(e + f*x + ArcTan[a/b]))] + Pi*Log[Cos[e + f* 
x]] + 2*ArcTan[a/b]*Log[Sin[e + f*x + ArcTan[a/b]]] + I*PolyLog[2, E^((2*I 
)*(e + f*x + ArcTan[a/b]))]))/(Sqrt[1 + a^2/b^2]*b))*Sec[e + f*x]^2*(a*Cos 
[e + f*x] + b*Sin[e + f*x])^2)/((a - I*b)*(a + I*b)*Sqrt[(a^2 + b^2)/b^2]* 
f^2*(a + b*Tan[e + f*x])^2) + (Sec[e + f*x]^2*(a*Cos[e + f*x] + b*Sin[e + 
f*x])*(-(b^2*d*e*Sin[e + f*x]) + b^2*c*f*Sin[e + f*x] + b^2*d*(e + f*x)*Si 
n[e + f*x]))/(a*(a - I*b)*(a + I*b)*f^2*(a + b*Tan[e + f*x])^2)
 
3.1.61.3 Rubi [A] (verified)

Time = 0.77 (sec) , antiderivative size = 228, normalized size of antiderivative = 1.07, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.389, Rules used = {3042, 4216, 3042, 4215, 2620, 2715, 2838}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {c+d x}{(a+b \tan (e+f x))^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {c+d x}{(a+b \tan (e+f x))^2}dx\)

\(\Big \downarrow \) 4216

\(\displaystyle \frac {\int \frac {b d+2 a f x d+2 a c f}{a+b \tan (e+f x)}dx}{f \left (a^2+b^2\right )}-\frac {b (c+d x)}{f \left (a^2+b^2\right ) (a+b \tan (e+f x))}-\frac {(c+d x)^2}{2 d \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \frac {b d+2 a f x d+2 a c f}{a+b \tan (e+f x)}dx}{f \left (a^2+b^2\right )}-\frac {b (c+d x)}{f \left (a^2+b^2\right ) (a+b \tan (e+f x))}-\frac {(c+d x)^2}{2 d \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 4215

\(\displaystyle \frac {2 i b \int \frac {e^{2 i (e+f x)} (b d+2 a f x d+2 a c f)}{(a+i b)^2+\left (a^2+b^2\right ) e^{2 i (e+f x)}}dx+\frac {(2 a c f+2 a d f x+b d)^2}{4 a d f (a+i b)}}{f \left (a^2+b^2\right )}-\frac {b (c+d x)}{f \left (a^2+b^2\right ) (a+b \tan (e+f x))}-\frac {(c+d x)^2}{2 d \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 2620

\(\displaystyle \frac {2 i b \left (\frac {i a d \int \log \left (\frac {e^{2 i (e+f x)} \left (a^2+b^2\right )}{(a+i b)^2}+1\right )dx}{a^2+b^2}-\frac {i (2 a c f+2 a d f x+b d) \log \left (1+\frac {\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{2 f \left (a^2+b^2\right )}\right )+\frac {(2 a c f+2 a d f x+b d)^2}{4 a d f (a+i b)}}{f \left (a^2+b^2\right )}-\frac {b (c+d x)}{f \left (a^2+b^2\right ) (a+b \tan (e+f x))}-\frac {(c+d x)^2}{2 d \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 2715

\(\displaystyle \frac {2 i b \left (\frac {a d \int e^{-2 i (e+f x)} \log \left (\frac {e^{2 i (e+f x)} \left (a^2+b^2\right )}{(a+i b)^2}+1\right )de^{2 i (e+f x)}}{2 f \left (a^2+b^2\right )}-\frac {i (2 a c f+2 a d f x+b d) \log \left (1+\frac {\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{2 f \left (a^2+b^2\right )}\right )+\frac {(2 a c f+2 a d f x+b d)^2}{4 a d f (a+i b)}}{f \left (a^2+b^2\right )}-\frac {b (c+d x)}{f \left (a^2+b^2\right ) (a+b \tan (e+f x))}-\frac {(c+d x)^2}{2 d \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 2838

\(\displaystyle \frac {2 i b \left (-\frac {i (2 a c f+2 a d f x+b d) \log \left (1+\frac {\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{2 f \left (a^2+b^2\right )}-\frac {a d \operatorname {PolyLog}\left (2,-\frac {\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{2 f \left (a^2+b^2\right )}\right )+\frac {(2 a c f+2 a d f x+b d)^2}{4 a d f (a+i b)}}{f \left (a^2+b^2\right )}-\frac {b (c+d x)}{f \left (a^2+b^2\right ) (a+b \tan (e+f x))}-\frac {(c+d x)^2}{2 d \left (a^2+b^2\right )}\)

input
Int[(c + d*x)/(a + b*Tan[e + f*x])^2,x]
 
output
-1/2*(c + d*x)^2/((a^2 + b^2)*d) + ((b*d + 2*a*c*f + 2*a*d*f*x)^2/(4*a*(a 
+ I*b)*d*f) + (2*I)*b*(((-1/2*I)*(b*d + 2*a*c*f + 2*a*d*f*x)*Log[1 + ((a^2 
 + b^2)*E^((2*I)*(e + f*x)))/(a + I*b)^2])/((a^2 + b^2)*f) - (a*d*PolyLog[ 
2, -(((a^2 + b^2)*E^((2*I)*(e + f*x)))/(a + I*b)^2)])/(2*(a^2 + b^2)*f)))/ 
((a^2 + b^2)*f) - (b*(c + d*x))/((a^2 + b^2)*f*(a + b*Tan[e + f*x]))
 

3.1.61.3.1 Defintions of rubi rules used

rule 2620
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ 
((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp 
[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si 
mp[d*(m/(b*f*g*n*Log[F]))   Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x 
)))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
 

rule 2715
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] 
:> Simp[1/(d*e*n*Log[F])   Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) 
))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
 

rule 2838
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 
, (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4215
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Sy 
mbol] :> Simp[(c + d*x)^(m + 1)/(d*(m + 1)*(a + I*b)), x] + Simp[2*I*b   In 
t[(c + d*x)^m*(E^Simp[2*I*(e + f*x), x]/((a + I*b)^2 + (a^2 + b^2)*E^Simp[2 
*I*(e + f*x), x])), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[a^2 + b^2 
, 0] && IGtQ[m, 0]
 

rule 4216
Int[((c_.) + (d_.)*(x_))/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol 
] :> Simp[-(c + d*x)^2/(2*d*(a^2 + b^2)), x] + (Simp[1/(f*(a^2 + b^2))   In 
t[(b*d + 2*a*c*f + 2*a*d*f*x)/(a + b*Tan[e + f*x]), x], x] - Simp[b*((c + d 
*x)/(f*(a^2 + b^2)*(a + b*Tan[e + f*x]))), x]) /; FreeQ[{a, b, c, d, e, f}, 
 x] && NeQ[a^2 + b^2, 0]
 
3.1.61.4 Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 2000 vs. \(2 (202 ) = 404\).

Time = 0.86 (sec) , antiderivative size = 2001, normalized size of antiderivative = 9.35

method result size
risch \(\text {Expression too large to display}\) \(2001\)

input
int((d*x+c)/(a+b*tan(f*x+e))^2,x,method=_RETURNVERBOSE)
 
output
4*I/(I*a+b)^2/f^2/(b-I*a)*b*a*d*e/(a+I*b)*ln(exp(I*(f*x+e)))+2*I/(I*a+b)^2 
/f/(b-I*a)*b^2*a*c/(a+I*b)/(I*b-a)*arctan(1/2/a*exp(2*I*(f*x+e))*b-1/2*b/a 
+1/2/b*a*exp(2*I*(f*x+e))+1/2/b*a)-2*I/(I*a+b)^2/f/(b-I*a)*b^2*a*c/(a+I*b) 
/(I*b-a)*arctan(1/b*a)+2*I/(I*a+b)^2/f^2/(b-I*a)*b/(a+I*b)*a*d*ln(1-(I*b-a 
)*exp(2*I*(f*x+e))/(a+I*b))*e-1/2*I/(I*a+b)^2/f^2/(b-I*a)*b^2*d/(a+I*b)/(I 
*b-a)*ln(a^2*exp(4*I*(f*x+e))+b^2*exp(4*I*(f*x+e))+2*a^2*exp(2*I*(f*x+e))- 
2*b^2*exp(2*I*(f*x+e))+a^2+b^2)*a-I/(I*a+b)^2/f/(b-I*a)*b*a^2*c/(a+I*b)/(I 
*b-a)*ln(a^2*exp(4*I*(f*x+e))+b^2*exp(4*I*(f*x+e))+2*a^2*exp(2*I*(f*x+e))- 
2*b^2*exp(2*I*(f*x+e))+a^2+b^2)+2*I/(I*a+b)^2/f/(b-I*a)*b/(a+I*b)*a*d*ln(1 
-(I*b-a)*exp(2*I*(f*x+e))/(a+I*b))*x-1/2/(2*I*a*b-a^2+b^2)*d*x^2-1/(2*I*a* 
b-a^2+b^2)*c*x+1/(I*a+b)^2/f^2/(b-I*a)*b/(a+I*b)*a*d*polylog(2,(I*b-a)*exp 
(2*I*(f*x+e))/(a+I*b))-1/2/(I*a+b)^2/f^2/(b-I*a)*b^3*d/(a+I*b)/(I*b-a)*ln( 
a^2*exp(4*I*(f*x+e))+b^2*exp(4*I*(f*x+e))+2*a^2*exp(2*I*(f*x+e))-2*b^2*exp 
(2*I*(f*x+e))+a^2+b^2)+2/(I*a+b)^2/f^2/(b-I*a)*b/(a+I*b)*a*d*e^2-2*I/(I*a+ 
b)^2/f^2/(b-I*a)*b^2*d/(a+I*b)*ln(exp(I*(f*x+e)))-2/(I*a+b)^2/f^2/(b-I*a)* 
b*a^2*d*e/(a+I*b)/(I*b-a)*arctan(1/b*a)+2/(I*a+b)^2/f^2/(b-I*a)*b*a^2*d*e/ 
(a+I*b)/(I*b-a)*arctan(1/2/a*exp(2*I*(f*x+e))*b-1/2*b/a+1/2/b*a*exp(2*I*(f 
*x+e))+1/2/b*a)+1/(I*a+b)^2/f^2/(b-I*a)*b^2*a*d*e/(a+I*b)/(I*b-a)*ln(a^2*e 
xp(4*I*(f*x+e))+b^2*exp(4*I*(f*x+e))+2*a^2*exp(2*I*(f*x+e))-2*b^2*exp(2*I* 
(f*x+e))+a^2+b^2)+4/(I*a+b)^2/f/(b-I*a)*b/(a+I*b)*a*d*e*x-1/(I*a+b)^2/f...
 
3.1.61.5 Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 843 vs. \(2 (197) = 394\).

Time = 0.27 (sec) , antiderivative size = 843, normalized size of antiderivative = 3.94 \[ \int \frac {c+d x}{(a+b \tan (e+f x))^2} \, dx=\frac {{\left (a^{3} - a b^{2}\right )} d f^{2} x^{2} - 2 \, b^{3} c f - 2 \, {\left (b^{3} d f - {\left (a^{3} - a b^{2}\right )} c f^{2}\right )} x + {\left (i \, a b^{2} d \tan \left (f x + e\right ) + i \, a^{2} b d\right )} {\rm Li}_2\left (\frac {2 \, {\left ({\left (i \, a b - b^{2}\right )} \tan \left (f x + e\right )^{2} - a^{2} - i \, a b + {\left (i \, a^{2} - 2 \, a b - i \, b^{2}\right )} \tan \left (f x + e\right )\right )}}{{\left (a^{2} + b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} + b^{2}} + 1\right ) + {\left (-i \, a b^{2} d \tan \left (f x + e\right ) - i \, a^{2} b d\right )} {\rm Li}_2\left (\frac {2 \, {\left ({\left (-i \, a b - b^{2}\right )} \tan \left (f x + e\right )^{2} - a^{2} + i \, a b + {\left (-i \, a^{2} - 2 \, a b + i \, b^{2}\right )} \tan \left (f x + e\right )\right )}}{{\left (a^{2} + b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} + b^{2}} + 1\right ) + 2 \, {\left (a^{2} b d f x + a^{2} b d e + {\left (a b^{2} d f x + a b^{2} d e\right )} \tan \left (f x + e\right )\right )} \log \left (-\frac {2 \, {\left ({\left (i \, a b - b^{2}\right )} \tan \left (f x + e\right )^{2} - a^{2} - i \, a b + {\left (i \, a^{2} - 2 \, a b - i \, b^{2}\right )} \tan \left (f x + e\right )\right )}}{{\left (a^{2} + b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} + b^{2}}\right ) + 2 \, {\left (a^{2} b d f x + a^{2} b d e + {\left (a b^{2} d f x + a b^{2} d e\right )} \tan \left (f x + e\right )\right )} \log \left (-\frac {2 \, {\left ({\left (-i \, a b - b^{2}\right )} \tan \left (f x + e\right )^{2} - a^{2} + i \, a b + {\left (-i \, a^{2} - 2 \, a b + i \, b^{2}\right )} \tan \left (f x + e\right )\right )}}{{\left (a^{2} + b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} + b^{2}}\right ) - {\left (2 \, a^{2} b d e - 2 \, a^{2} b c f - a b^{2} d + {\left (2 \, a b^{2} d e - 2 \, a b^{2} c f - b^{3} d\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {{\left (i \, a b + b^{2}\right )} \tan \left (f x + e\right )^{2} - a^{2} + i \, a b + {\left (i \, a^{2} + i \, b^{2}\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}\right ) - {\left (2 \, a^{2} b d e - 2 \, a^{2} b c f - a b^{2} d + {\left (2 \, a b^{2} d e - 2 \, a b^{2} c f - b^{3} d\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {{\left (i \, a b - b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} + i \, a b + {\left (i \, a^{2} + i \, b^{2}\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}\right ) + {\left ({\left (a^{2} b - b^{3}\right )} d f^{2} x^{2} + 2 \, a b^{2} c f + 2 \, {\left (a b^{2} d f + {\left (a^{2} b - b^{3}\right )} c f^{2}\right )} x\right )} \tan \left (f x + e\right )}{2 \, {\left ({\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} f^{2} \tan \left (f x + e\right ) + {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} f^{2}\right )}} \]

input
integrate((d*x+c)/(a+b*tan(f*x+e))^2,x, algorithm="fricas")
 
output
1/2*((a^3 - a*b^2)*d*f^2*x^2 - 2*b^3*c*f - 2*(b^3*d*f - (a^3 - a*b^2)*c*f^ 
2)*x + (I*a*b^2*d*tan(f*x + e) + I*a^2*b*d)*dilog(2*((I*a*b - b^2)*tan(f*x 
 + e)^2 - a^2 - I*a*b + (I*a^2 - 2*a*b - I*b^2)*tan(f*x + e))/((a^2 + b^2) 
*tan(f*x + e)^2 + a^2 + b^2) + 1) + (-I*a*b^2*d*tan(f*x + e) - I*a^2*b*d)* 
dilog(2*((-I*a*b - b^2)*tan(f*x + e)^2 - a^2 + I*a*b + (-I*a^2 - 2*a*b + I 
*b^2)*tan(f*x + e))/((a^2 + b^2)*tan(f*x + e)^2 + a^2 + b^2) + 1) + 2*(a^2 
*b*d*f*x + a^2*b*d*e + (a*b^2*d*f*x + a*b^2*d*e)*tan(f*x + e))*log(-2*((I* 
a*b - b^2)*tan(f*x + e)^2 - a^2 - I*a*b + (I*a^2 - 2*a*b - I*b^2)*tan(f*x 
+ e))/((a^2 + b^2)*tan(f*x + e)^2 + a^2 + b^2)) + 2*(a^2*b*d*f*x + a^2*b*d 
*e + (a*b^2*d*f*x + a*b^2*d*e)*tan(f*x + e))*log(-2*((-I*a*b - b^2)*tan(f* 
x + e)^2 - a^2 + I*a*b + (-I*a^2 - 2*a*b + I*b^2)*tan(f*x + e))/((a^2 + b^ 
2)*tan(f*x + e)^2 + a^2 + b^2)) - (2*a^2*b*d*e - 2*a^2*b*c*f - a*b^2*d + ( 
2*a*b^2*d*e - 2*a*b^2*c*f - b^3*d)*tan(f*x + e))*log(((I*a*b + b^2)*tan(f* 
x + e)^2 - a^2 + I*a*b + (I*a^2 + I*b^2)*tan(f*x + e))/(tan(f*x + e)^2 + 1 
)) - (2*a^2*b*d*e - 2*a^2*b*c*f - a*b^2*d + (2*a*b^2*d*e - 2*a*b^2*c*f - b 
^3*d)*tan(f*x + e))*log(((I*a*b - b^2)*tan(f*x + e)^2 + a^2 + I*a*b + (I*a 
^2 + I*b^2)*tan(f*x + e))/(tan(f*x + e)^2 + 1)) + ((a^2*b - b^3)*d*f^2*x^2 
 + 2*a*b^2*c*f + 2*(a*b^2*d*f + (a^2*b - b^3)*c*f^2)*x)*tan(f*x + e))/((a^ 
4*b + 2*a^2*b^3 + b^5)*f^2*tan(f*x + e) + (a^5 + 2*a^3*b^2 + a*b^4)*f^2)
 
3.1.61.6 Sympy [F]

\[ \int \frac {c+d x}{(a+b \tan (e+f x))^2} \, dx=\int \frac {c + d x}{\left (a + b \tan {\left (e + f x \right )}\right )^{2}}\, dx \]

input
integrate((d*x+c)/(a+b*tan(f*x+e))**2,x)
 
output
Integral((c + d*x)/(a + b*tan(e + f*x))**2, x)
 
3.1.61.7 Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1156 vs. \(2 (197) = 394\).

Time = 0.71 (sec) , antiderivative size = 1156, normalized size of antiderivative = 5.40 \[ \int \frac {c+d x}{(a+b \tan (e+f x))^2} \, dx=\text {Too large to display} \]

input
integrate((d*x+c)/(a+b*tan(f*x+e))^2,x, algorithm="maxima")
 
output
1/2*((a^3 - I*a^2*b + a*b^2 - I*b^3)*d*f^2*x^2 + 2*(a^3 - I*a^2*b + a*b^2 
- I*b^3)*c*f^2*x - 4*(-I*a*b^2 + b^3)*c*f - 2*(2*(-I*a^2*b + a*b^2)*c*f + 
(-I*a*b^2 + b^3)*d + (2*(-I*a^2*b - a*b^2)*c*f + (-I*a*b^2 - b^3)*d)*cos(2 
*f*x + 2*e) + (2*(a^2*b - I*a*b^2)*c*f + (a*b^2 - I*b^3)*d)*sin(2*f*x + 2* 
e))*arctan2(-b*cos(2*f*x + 2*e) + a*sin(2*f*x + 2*e) + b, a*cos(2*f*x + 2* 
e) + b*sin(2*f*x + 2*e) + a) - 4*((I*a^2*b + a*b^2)*d*f*x*cos(2*f*x + 2*e) 
 - (a^2*b - I*a*b^2)*d*f*x*sin(2*f*x + 2*e) + (I*a^2*b - a*b^2)*d*f*x)*arc 
tan2((2*a*b*cos(2*f*x + 2*e) - (a^2 - b^2)*sin(2*f*x + 2*e))/(a^2 + b^2), 
(2*a*b*sin(2*f*x + 2*e) + a^2 + b^2 + (a^2 - b^2)*cos(2*f*x + 2*e))/(a^2 + 
 b^2)) + ((a^3 - 3*I*a^2*b - 3*a*b^2 + I*b^3)*d*f^2*x^2 + 2*((a^3 - 3*I*a^ 
2*b - 3*a*b^2 + I*b^3)*c*f^2 - 2*(I*a*b^2 + b^3)*d*f)*x)*cos(2*f*x + 2*e) 
- 2*((I*a^2*b + a*b^2)*d*cos(2*f*x + 2*e) - (a^2*b - I*a*b^2)*d*sin(2*f*x 
+ 2*e) + (I*a^2*b - a*b^2)*d)*dilog((I*a + b)*e^(2*I*f*x + 2*I*e)/(-I*a + 
b)) + (2*(a^2*b + I*a*b^2)*c*f + (a*b^2 + I*b^3)*d + (2*(a^2*b - I*a*b^2)* 
c*f + (a*b^2 - I*b^3)*d)*cos(2*f*x + 2*e) - (2*(-I*a^2*b - a*b^2)*c*f - (I 
*a*b^2 + b^3)*d)*sin(2*f*x + 2*e))*log((a^2 + b^2)*cos(2*f*x + 2*e)^2 + 4* 
a*b*sin(2*f*x + 2*e) + (a^2 + b^2)*sin(2*f*x + 2*e)^2 + a^2 + b^2 + 2*(a^2 
 - b^2)*cos(2*f*x + 2*e)) + 2*((a^2*b - I*a*b^2)*d*f*x*cos(2*f*x + 2*e) - 
(-I*a^2*b - a*b^2)*d*f*x*sin(2*f*x + 2*e) + (a^2*b + I*a*b^2)*d*f*x)*log(( 
(a^2 + b^2)*cos(2*f*x + 2*e)^2 + 4*a*b*sin(2*f*x + 2*e) + (a^2 + b^2)*s...
 
3.1.61.8 Giac [F]

\[ \int \frac {c+d x}{(a+b \tan (e+f x))^2} \, dx=\int { \frac {d x + c}{{\left (b \tan \left (f x + e\right ) + a\right )}^{2}} \,d x } \]

input
integrate((d*x+c)/(a+b*tan(f*x+e))^2,x, algorithm="giac")
 
output
integrate((d*x + c)/(b*tan(f*x + e) + a)^2, x)
 
3.1.61.9 Mupad [F(-1)]

Timed out. \[ \int \frac {c+d x}{(a+b \tan (e+f x))^2} \, dx=\int \frac {c+d\,x}{{\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )}^2} \,d x \]

input
int((c + d*x)/(a + b*tan(e + f*x))^2,x)
 
output
int((c + d*x)/(a + b*tan(e + f*x))^2, x)